package com.yahoo.labs.cluster;

import cern.colt.matrix.impl.SparseDoubleMatrix2D;

import com.yahoo.labs.snow.util.MatrixUtils;

/**
 * Clusters a graph.
 * 
 * @author chato
 *
 */
public class Clustering {
	
	public static int[] cluster(SparseDoubleMatrix2D graph, int numClusters) {
		return (new MetisWrapper()).cluster(graph, numClusters);
	}
	
	public static int[] symmetrizeAndCluster(SparseDoubleMatrix2D graph, int numClusters) {
		MatrixUtils.ensureSymmetric(graph);
		return (new MetisWrapper()).cluster(graph, numClusters);
	}
}
